package com.kaizzi.data.jdl.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kaizzi.data.common.been.TempBeen;
import com.kaizzi.data.jdl.entity.User;
import com.kaizzi.data.jdl.mapper.UserMapper;
import com.kaizzi.data.jdl.service.JdlNumService;
import com.kaizzi.data.jdl.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Kzen
 * @Description description
 * @date 2020/9/14
 */
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;
    @Resource
    private JdlNumService jdlNumService;

    @Override
    @DS("jdl_view")
    public List<TempBeen> getWesPullNew(String endDate) {
        return userMapper.getWesPullNew(endDate);
    }

    @Override
    @DS("jdl_view")
    public long getYtdWes(String startDate, String endDate) {
        Long ytdWes = userMapper.getYtdWes(startDate, endDate);
        return jdlNumService.transNum(ytdWes);
    }
}
